package vn.com.fsoft.model.entities;

import java.util.HashSet;
import java.util.Set;

import javax.persistence.*;

@Entity
@Table(name="TRUSTREGION")
public class Trustregion {
	private int trustregionId;
	private String name;
	private String description;
	private Country countryRegion;
	private Set<Trustdistrict> trustdistrict = new HashSet<Trustdistrict>(0);
	
	public Trustregion(int trustregionId, String name, String description,
			Country country) {
		super();
		this.trustregionId = trustregionId;
		this.name = name;
		this.description = description;
		this.countryRegion = country;
	}
	public Trustregion() {
		super();
	}
	@Id
	@GeneratedValue(strategy=GenerationType.IDENTITY)
	@Column(name="TRUSTREGION_ID",nullable=false,unique=true)
	public int getTrustregionId() {
		return trustregionId;
	}
	public void setTrustregionId(int trustregionId) {
		this.trustregionId = trustregionId;
	}
	@Column(name="NAME",length=50)
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	@Column(name="DESCRIPTION",length=300)
	public String getDescription() {
		return description;
	}
	public void setDescription(String description) {
		this.description = description;
	}
	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "COUNTRY_ID", nullable = false)
	public Country getCountryRegion() {
		return countryRegion;
	}
	public void setCountryRegion(Country country) {
		this.countryRegion = country;
	}
	@OneToMany(fetch = FetchType.LAZY, mappedBy = "regionDistrict")
	public Set<Trustdistrict> getTrustdistrict() {
		return trustdistrict;
	}
	public void setTrustdistrict(Set<Trustdistrict> trustdistrict) {
		this.trustdistrict = trustdistrict;
	}
	
}
